var jsEngs = [ "Nashorn", "Rhino", "V8", "IonMonkey", "Nitro" ];
for each (js in jsEngs) {
    print(js);
}

function getJSONObj(){
	return {
		'manager':5000,
		'common':3500,
		'waiter':3600
	}
}



var imports = new JavaImporter(java.io, java.lang);
with (imports) {
    var file = new File(__FILE__);
    System.out.println(file.getAbsolutePath());
    // /path/to/my/script.js
}


var url = com.changlie.generator.test.JsEngineDemo.class.getClassLoader().getResource("")
print(url.getFile())
load(url+'script/local.js')
//load('F:/testspace/local.js')
executeLocalJs('tom')

// 加载调用 远程  js
//load('http://localhost:8080/standard/test.js')
//executeRemoteJs()


var dao = null

function initDao(jdbc){
	dao = jdbc
	print(dao)
}

function useDao(){
	dao.demo()
}

function getCode(){
	return 'Stream(people).filter({married: true, gender: \'male\'}).sorted("lastName").groupBy("age");'
}


function testList(list){
	print("=>", list)
	for each (var el in list){
		print(el)
	}
}


function getSalary(role){
	var a = {
			'manager':5000,
			'common':3500,
			'waiter':3600
	}
	var ret = a[role]
	if(!ret){
		return 1000
	}
	return ret
}